<?php

namespace App\Http\Controllers\Api;

use App\Models\Users;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Redis;
use JWTAuth;
use JWTFactory;
use Spatie\Permission\Models\Permission;
use Spatie\Permission\Models\Role;

class TestController extends CommonController
{
    public function test()
    {

        return $this->successReturn(200,1);
//
//        $user = Users::find(1);
////
////        $user->assignRole('writer');
//
//        $role = Role::findById(1);
////        $role->givePermissionTo('edit articles');
//        $res = $user->hasRole('writer');
            Permission::create(['name' => 'edit articles', 'group_name' => 'Edit']);

        return $this->successReturn(200,1);

    }
}
